<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>hybridMPIC: laser.h Source File</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">hybridMPIC
   </div>
   <div id="projectbrief">A fully relativisitic 2d Particle-In-Cell(PIC) code, with explicit solver, MPI&amp;OpenMP support</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="../../annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">laser.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef __laser</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define __laser</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include&lt;vector&gt;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;type.h&quot;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &quot;fields.h&quot;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include&quot;simbox.h&quot;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;</div>
<div class="line"><a name="l00010"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html">   10</a></span>&#160;<span class="keyword">class </span><a class="code" href="../../d1/d4f/class____Laser.html">__Laser</a>{</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;    <span class="keyword">public</span>:</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;        <span class="keywordtype">int</span> is_able;</div>
<div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#a3adbde5637037815e00d66856233efea">   14</a></span>&#160;        <span class="keywordtype">double</span> <a class="code" href="../../d1/d4f/class____Laser.html#a3adbde5637037815e00d66856233efea">delta_t</a>;</div>
<div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#a7bc70ac6861f0ad5e834df4ed5d14f72">   16</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="../../d1/d4f/class____Laser.html#a7bc70ac6861f0ad5e834df4ed5d14f72">type</a>;</div>
<div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#a57188568219826c448ed6b030601bb13">   18</a></span>&#160;        <a class="code" href="../../d6/d9c/class____Vect2.html">__Vect2&lt;double&gt;</a> <a class="code" href="../../d1/d4f/class____Laser.html#a57188568219826c448ed6b030601bb13">xysize</a>;</div>
<div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#a798ffe2c5a2cd1376d45f24b546e1d80">   20</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="../../d1/d4f/class____Laser.html#a798ffe2c5a2cd1376d45f24b546e1d80">id</a>;</div>
<div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#ad0bbaf48f79d1dd5154dd667c716cd41">   22</a></span>&#160;        <span class="keywordtype">long</span> <a class="code" href="../../d1/d4f/class____Laser.html#ad0bbaf48f79d1dd5154dd667c716cd41">t_now</a>;</div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#ac70915a139c1f6e59441c2062dddb3d5">   24</a></span>&#160;        <span class="keywordtype">double</span> <a class="code" href="../../d1/d4f/class____Laser.html#ac70915a139c1f6e59441c2062dddb3d5">t_center</a>, duration;</div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#a1fc2d88b82fd2efe9db5513a95f3d9bb">   26</a></span>&#160;        <span class="keywordtype">double</span> <a class="code" href="../../d1/d4f/class____Laser.html#a1fc2d88b82fd2efe9db5513a95f3d9bb">amp</a>;</div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#a846870a5d8de3cc078ddd66700996a63">   28</a></span>&#160;        <span class="keywordtype">double</span> <a class="code" href="../../d1/d4f/class____Laser.html#a846870a5d8de3cc078ddd66700996a63">omega</a>;</div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#a04dacd0405e63c4cd7b3ac5977f7fe8f">   30</a></span>&#160;        <span class="keywordtype">double</span> <a class="code" href="../../d1/d4f/class____Laser.html#a04dacd0405e63c4cd7b3ac5977f7fe8f">waist</a>;</div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#a4278e55cd5f57a214d2fdb5be788a17f">   32</a></span>&#160;        vector&lt;__Vect3&lt;double&gt; &gt; <a class="code" href="../../d1/d4f/class____Laser.html#a4278e55cd5f57a214d2fdb5be788a17f">efields</a>;</div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#a425ffb2d0b73f19e1d10d364ea214202">   34</a></span>&#160;        vector&lt;__Vect2&lt;long&gt; &gt; <a class="code" href="../../d1/d4f/class____Laser.html#a425ffb2d0b73f19e1d10d364ea214202">position</a>;</div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#a8ea7ac28593605c07d254f9e84a8d931">   36</a></span>&#160;        <a class="code" href="../../d6/d9c/class____Vect2.html">__Vect2&lt;long&gt;</a> <a class="code" href="../../d1/d4f/class____Laser.html#a8ea7ac28593605c07d254f9e84a8d931">gridsize</a>;</div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#a8608b499056e87e48b915defa2ee95a1">   38</a></span>&#160;        <a class="code" href="../../d6/d9c/class____Vect2.html">__Vect2&lt;double&gt;</a> <a class="code" href="../../d1/d4f/class____Laser.html#a8608b499056e87e48b915defa2ee95a1">xymin</a>;</div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#ab22af491f9052eb9dcb94c3e35dc0ec8">   40</a></span>&#160;        <a class="code" href="../../d6/d9c/class____Vect2.html">__Vect2&lt;double&gt;</a> <a class="code" href="../../d1/d4f/class____Laser.html#ab22af491f9052eb9dcb94c3e35dc0ec8">xymax</a>;</div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#a97f1a2e98043e789ebffe308663e9ee0">   42</a></span>&#160;        <a class="code" href="../../d6/d9c/class____Vect2.html">__Vect2&lt;double&gt;</a> <a class="code" href="../../d1/d4f/class____Laser.html#a97f1a2e98043e789ebffe308663e9ee0">pos</a>;</div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#ae4c0afc11f2dffab26ce9475c02364f1">   44</a></span>&#160;        <span class="keywordtype">long</span> <a class="code" href="../../d1/d4f/class____Laser.html#ae4c0afc11f2dffab26ce9475c02364f1">x</a>;</div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#a60f5638443ebedce6cb7cd692c4430a4">   46</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="../../d1/d4f/class____Laser.html#a60f5638443ebedce6cb7cd692c4430a4">polarization</a>;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        <span class="comment">// position 与 efields 一一对应</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        <a class="code" href="../../d1/d4f/class____Laser.html">__Laser</a>(){}</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        <a class="code" href="../../d1/d4f/class____Laser.html">__Laser</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> <span class="keywordtype">int</span> type, <span class="keyword">const</span> <span class="keywordtype">double</span>&amp; dt, <span class="keyword">const</span> <span class="keywordtype">double</span>&amp; t_center, \</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span>&amp; duration_in_um, <span class="keyword">const</span>\</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;                <a class="code" href="../../d6/d9c/class____Vect2.html">__Vect2&lt;double&gt;</a> pos, <span class="keyword">const</span> <span class="keywordtype">double</span>&amp; wavelength, <span class="keyword">const</span> <a class="code" href="../../d6/d9c/class____Vect2.html">__Vect2&lt;double&gt;</a>&amp; xymin,\</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;                <span class="keyword">const</span> <a class="code" href="../../d6/d9c/class____Vect2.html">__Vect2&lt;double&gt;</a>&amp; xymax, <span class="keyword">const</span> <a class="code" href="../../d6/d9c/class____Vect2.html">__Vect2&lt;long&gt;</a>&amp; gridsize, <span class="keyword">const</span> <a class="code" href="../../d6/d9c/class____Vect2.html">__Vect2&lt;double&gt;</a>&amp; xysize,  \</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span>&amp; waist, <span class="keyword">const</span> <span class="keywordtype">double</span>&amp; amplitude, <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; polarization)\</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;            :<a class="code" href="../../d1/d4f/class____Laser.html#a798ffe2c5a2cd1376d45f24b546e1d80">id</a>(<span class="keywordtype">id</span>), <a class="code" href="../../d1/d4f/class____Laser.html#a7bc70ac6861f0ad5e834df4ed5d14f72">type</a>(type), <a class="code" href="../../d1/d4f/class____Laser.html#a3adbde5637037815e00d66856233efea">delta_t</a>(dt), <a class="code" href="../../d1/d4f/class____Laser.html#ac70915a139c1f6e59441c2062dddb3d5">t_center</a>(t_center), <a class="code" href="../../d1/d4f/class____Laser.html#a8608b499056e87e48b915defa2ee95a1">xymin</a>(xymin), <a class="code" href="../../d1/d4f/class____Laser.html#ab22af491f9052eb9dcb94c3e35dc0ec8">xymax</a>(xymax)\</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;            , <a class="code" href="../../d1/d4f/class____Laser.html#a04dacd0405e63c4cd7b3ac5977f7fe8f">waist</a>(waist), <a class="code" href="../../d1/d4f/class____Laser.html#a57188568219826c448ed6b030601bb13">xysize</a>(xysize), <a class="code" href="../../d1/d4f/class____Laser.html#a1fc2d88b82fd2efe9db5513a95f3d9bb">amp</a>(amplitude), <a class="code" href="../../d1/d4f/class____Laser.html#a97f1a2e98043e789ebffe308663e9ee0">pos</a>(pos), <a class="code" href="../../d1/d4f/class____Laser.html#a8ea7ac28593605c07d254f9e84a8d931">gridsize</a>(gridsize), <a class="code" href="../../d1/d4f/class____Laser.html#a60f5638443ebedce6cb7cd692c4430a4">\</a></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<a class="code" href="../../d1/d4f/class____Laser.html#a60f5638443ebedce6cb7cd692c4430a4">            polarization</a>(polarization)</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;            {</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;                t_now = 0;</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;                x = long((pos.member[0] - xymin.member[0] + xysize.member[0]) / xysize.member[0]);</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;                <span class="keywordflow">if</span>(polarization == 0)</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;                {</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;                    x = long((pos.member[1] - xymin.member[1] + xysize.member[1]) / xysize.member[1]);</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;                }</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;                duration = duration_in_um / c_light_speed;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;                omega = 2.0 * PI * c_light_speed / wavelength;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;                cout&lt;&lt;<span class="stringliteral">&quot; omega = &quot;</span>&lt;&lt;omega&lt;&lt;endl;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;                <span class="keywordflow">if</span>(pos &gt; xymin &amp;&amp; pos &lt; xymax)</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;                {</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;                    is_able = 1;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;                }<span class="keywordflow">else</span></div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;                {</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;                    is_able = 0;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;                }</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;            }</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        ~<a class="code" href="../../d1/d4f/class____Laser.html">__Laser</a>(){}</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="../../d1/d4f/class____Laser.html#a91dc75764bea7158fd57fecef11b6e0a">update</a>();</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="../../d1/d4f/class____Laser.html#a64ea679d430642f19e15fa1b87da002b">setting_fields</a>(<a class="code" href="../../d9/d37/class____Simbox.html">__Simbox</a>&amp; mysimbox);</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;};</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#a91dc75764bea7158fd57fecef11b6e0a">   82</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="../../d1/d4f/class____Laser.html#a91dc75764bea7158fd57fecef11b6e0a">__Laser::update</a>()</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;{</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <span class="keywordflow">if</span>(!is_able)</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    {</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    }</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="keywordtype">double</span> mytime = abs(delta_t * t_now - t_center);</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="keywordflow">if</span>(mytime &gt; duration * 5.0)</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    {</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    }</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    t_now ++;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="comment">// 场和位置重新计算</span></div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    position.clear();</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    efields.clear();</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="comment">// 只需要给定从那个边界出来，即给定一个x的坐标就可以</span></div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="comment">// 在这里给出一个对应的formula来确定激光的形状</span></div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="comment">// 我们假设一个y方向偏振高斯波包吧</span></div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <span class="comment">// ey = exp(-(x^2 + y^2) / 2 / l^2) * sin(wt)</span></div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="comment">// j 的下界应该是1,但0处无值对于0进程，1进程可以交换的到。</span></div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="keywordtype">double</span> length;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">int</span> j = 0; j &lt; gridsize.member[1]; j ++)</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    {</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        <a class="code" href="../../d6/d9c/class____Vect2.html">__Vect2&lt;long&gt;</a> temppos(x, j);</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        <span class="keywordflow">if</span>(polarization == 0)</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        {</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;            length = abs(pos.member[0] - xymin.member[0] - j * xysize.member[0]);</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;            temppos = <a class="code" href="../../d6/d9c/class____Vect2.html">__Vect2&lt;long&gt;</a>(j, <a class="code" href="../../d1/d4f/class____Laser.html#ae4c0afc11f2dffab26ce9475c02364f1">x</a>);</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;        }</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;        <span class="keywordflow">else</span>{</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;            length = abs(pos.member[1] - xymin.member[1] - j * xysize.member[1]);</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;        }</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        position.push_back(temppos);</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;        <a class="code" href="../../da/d1a/class____Vect3.html">__Vect3&lt;double&gt;</a> tempefields(0, 0, 0);</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        <span class="keywordflow">if</span>(type == 0)</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;        {</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;            tempefields.member[<a class="code" href="../../d1/d4f/class____Laser.html#a60f5638443ebedce6cb7cd692c4430a4">polarization</a>] = amp * exp(-(length * length) / waist / waist / 2.0) \</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;                                * exp(-(mytime * mytime) / (duration * duration) / 2.0)\</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;                                        * sin(omega * t_now * delta_t);</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        </div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;            efields.push_back(tempefields);</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        }</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span>(type == 1)</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        {</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;            tempefields.member[1] = amp * exp(-(length * length) / waist / waist / 2.0) \</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;                                * exp(-(mytime / duration) * ( mytime / duration) / 2.0)\</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;                                        * sin(omega * t_now * delta_t);</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;            tempefields.member[2] = amp * exp(-(length * length) / waist / waist / 2.0) \</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;                                * exp(-(mytime / duration) * ( mytime / duration) / 2.0)\</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;                                        * sin(omega * t_now * delta_t + PI * 0.5);</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;            efields.push_back(tempefields);</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;        }</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    }</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    </div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    </div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;}</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;</div>
<div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="../../d1/d4f/class____Laser.html#a64ea679d430642f19e15fa1b87da002b">  139</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="../../d1/d4f/class____Laser.html#a64ea679d430642f19e15fa1b87da002b">__Laser::setting_fields</a>(<a class="code" href="../../d9/d37/class____Simbox.html">__Simbox</a>&amp; mysimbox)</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;{</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    <span class="keywordflow">if</span>(!is_able)</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    {</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    }</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    <span class="keywordtype">double</span> mytime = delta_t * <a class="code" href="../../d1/d4f/class____Laser.html#ad0bbaf48f79d1dd5154dd667c716cd41">t_now</a>;</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <span class="keywordflow">if</span>(mytime &gt; 5.0 * duration)</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    {</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    }</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; efields.size(); i ++)</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    {</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;        <span class="keywordflow">if</span>(position[i].member[0] &lt; mysimbox.<a class="code" href="../../d9/d37/class____Simbox.html#aa86ece574ff59da44debc92461c5d2af">fieldgroup</a>.<a class="code" href="../../d7/dd8/class____Fieldgroup.html#a3e9ceb9a297453c70487e0f3ef50b767">member</a>.size() &amp;&amp; <a class="code" href="../../d1/d4f/class____Laser.html#a425ffb2d0b73f19e1d10d364ea214202">\</a></div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;<a class="code" href="../../d1/d4f/class____Laser.html#a425ffb2d0b73f19e1d10d364ea214202">                position</a>[i].member[0] &gt;= 0 &amp;&amp; \</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;                mysimbox.fieldgroup.member[0].size() &gt; position[i].member[1] &amp;&amp; <a class="code" href="../../d1/d4f/class____Laser.html#a425ffb2d0b73f19e1d10d364ea214202">\</a></div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;<a class="code" href="../../d1/d4f/class____Laser.html#a425ffb2d0b73f19e1d10d364ea214202">                position</a>[i].member[1] &gt;= 0)</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;        {</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;            mysimbox.<a class="code" href="../../d9/d37/class____Simbox.html#aa86ece574ff59da44debc92461c5d2af">fieldgroup</a>.<a class="code" href="../../d7/dd8/class____Fieldgroup.html#a3e9ceb9a297453c70487e0f3ef50b767">member</a>[position[i].member[0]]\</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;                [position[i].member[1]].efield = efields[i];</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;        }</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;    }</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    efields.clear();</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;}</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="class____Laser_html_a1fc2d88b82fd2efe9db5513a95f3d9bb"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#a1fc2d88b82fd2efe9db5513a95f3d9bb">__Laser::amp</a></div><div class="ttdeci">double amp</div><div class="ttdoc">脉冲电场振幅 </div><div class="ttdef"><b>Definition:</b> laser.h:26</div></div>
<div class="ttc" id="class____Laser_html_a04dacd0405e63c4cd7b3ac5977f7fe8f"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#a04dacd0405e63c4cd7b3ac5977f7fe8f">__Laser::waist</a></div><div class="ttdeci">double waist</div><div class="ttdoc">束腰宽度 </div><div class="ttdef"><b>Definition:</b> laser.h:30</div></div>
<div class="ttc" id="class____Vect2_html"><div class="ttname"><a href="../../d6/d9c/class____Vect2.html">__Vect2&lt; double &gt;</a></div></div>
<div class="ttc" id="class____Laser_html_a8ea7ac28593605c07d254f9e84a8d931"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#a8ea7ac28593605c07d254f9e84a8d931">__Laser::gridsize</a></div><div class="ttdeci">__Vect2&lt; long &gt; gridsize</div><div class="ttdoc">当前场群的大小 </div><div class="ttdef"><b>Definition:</b> laser.h:36</div></div>
<div class="ttc" id="class____Laser_html_a97f1a2e98043e789ebffe308663e9ee0"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#a97f1a2e98043e789ebffe308663e9ee0">__Laser::pos</a></div><div class="ttdeci">__Vect2&lt; double &gt; pos</div><div class="ttdoc">激光发射的中心位置 </div><div class="ttdef"><b>Definition:</b> laser.h:42</div></div>
<div class="ttc" id="class____Laser_html_a64ea679d430642f19e15fa1b87da002b"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#a64ea679d430642f19e15fa1b87da002b">__Laser::setting_fields</a></div><div class="ttdeci">void setting_fields(__Simbox &amp;mysimbox)</div><div class="ttdoc">对mysimbox设置 </div><div class="ttdef"><b>Definition:</b> laser.h:139</div></div>
<div class="ttc" id="class____Laser_html_a7bc70ac6861f0ad5e834df4ed5d14f72"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#a7bc70ac6861f0ad5e834df4ed5d14f72">__Laser::type</a></div><div class="ttdeci">int type</div><div class="ttdoc">type 0: 线偏振，1, 圆偏真 </div><div class="ttdef"><b>Definition:</b> laser.h:16</div></div>
<div class="ttc" id="class____Laser_html_ac70915a139c1f6e59441c2062dddb3d5"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#ac70915a139c1f6e59441c2062dddb3d5">__Laser::t_center</a></div><div class="ttdeci">double t_center</div><div class="ttdoc">起始时间和脉冲时间宽度 </div><div class="ttdef"><b>Definition:</b> laser.h:24</div></div>
<div class="ttc" id="class____Laser_html_a798ffe2c5a2cd1376d45f24b546e1d80"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#a798ffe2c5a2cd1376d45f24b546e1d80">__Laser::id</a></div><div class="ttdeci">int id</div><div class="ttdoc">激光的id </div><div class="ttdef"><b>Definition:</b> laser.h:20</div></div>
<div class="ttc" id="class____Laser_html_ad0bbaf48f79d1dd5154dd667c716cd41"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#ad0bbaf48f79d1dd5154dd667c716cd41">__Laser::t_now</a></div><div class="ttdeci">long t_now</div><div class="ttdoc">记录当前地多少个dt </div><div class="ttdef"><b>Definition:</b> laser.h:22</div></div>
<div class="ttc" id="class____Laser_html_a91dc75764bea7158fd57fecef11b6e0a"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#a91dc75764bea7158fd57fecef11b6e0a">__Laser::update</a></div><div class="ttdeci">void update()</div><div class="ttdoc">更新一步 </div><div class="ttdef"><b>Definition:</b> laser.h:82</div></div>
<div class="ttc" id="class____Laser_html_a60f5638443ebedce6cb7cd692c4430a4"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#a60f5638443ebedce6cb7cd692c4430a4">__Laser::polarization</a></div><div class="ttdeci">int polarization</div><div class="ttdoc">偏振方向： </div><div class="ttdef"><b>Definition:</b> laser.h:46</div></div>
<div class="ttc" id="class____Laser_html_ae4c0afc11f2dffab26ce9475c02364f1"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#ae4c0afc11f2dffab26ce9475c02364f1">__Laser::x</a></div><div class="ttdeci">long x</div><div class="ttdoc">中间变量，用于存储 激光横向延伸的网格 </div><div class="ttdef"><b>Definition:</b> laser.h:44</div></div>
<div class="ttc" id="class____Laser_html"><div class="ttname"><a href="../../d1/d4f/class____Laser.html">__Laser</a></div><div class="ttdoc">产生一个激光，但需要实时更新 </div><div class="ttdef"><b>Definition:</b> laser.h:10</div></div>
<div class="ttc" id="class____Laser_html_a4278e55cd5f57a214d2fdb5be788a17f"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#a4278e55cd5f57a214d2fdb5be788a17f">__Laser::efields</a></div><div class="ttdeci">vector&lt; __Vect3&lt; double &gt; &gt; efields</div><div class="ttdoc">生成的电场信息 </div><div class="ttdef"><b>Definition:</b> laser.h:32</div></div>
<div class="ttc" id="class____Laser_html_a8608b499056e87e48b915defa2ee95a1"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#a8608b499056e87e48b915defa2ee95a1">__Laser::xymin</a></div><div class="ttdeci">__Vect2&lt; double &gt; xymin</div><div class="ttdoc">当前box的xymin </div><div class="ttdef"><b>Definition:</b> laser.h:38</div></div>
<div class="ttc" id="class____Laser_html_a846870a5d8de3cc078ddd66700996a63"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#a846870a5d8de3cc078ddd66700996a63">__Laser::omega</a></div><div class="ttdeci">double omega</div><div class="ttdoc">激光频率 </div><div class="ttdef"><b>Definition:</b> laser.h:28</div></div>
<div class="ttc" id="class____Fieldgroup_html_a3e9ceb9a297453c70487e0f3ef50b767"><div class="ttname"><a href="../../d7/dd8/class____Fieldgroup.html#a3e9ceb9a297453c70487e0f3ef50b767">__Fieldgroup::member</a></div><div class="ttdeci">vector&lt; vector&lt; __Fields &gt; &gt; member</div><div class="ttdoc">field成员 </div><div class="ttdef"><b>Definition:</b> fields.h:18</div></div>
<div class="ttc" id="class____Laser_html_ab22af491f9052eb9dcb94c3e35dc0ec8"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#ab22af491f9052eb9dcb94c3e35dc0ec8">__Laser::xymax</a></div><div class="ttdeci">__Vect2&lt; double &gt; xymax</div><div class="ttdoc">当前box的ximax </div><div class="ttdef"><b>Definition:</b> laser.h:40</div></div>
<div class="ttc" id="class____Simbox_html_aa86ece574ff59da44debc92461c5d2af"><div class="ttname"><a href="../../d9/d37/class____Simbox.html#aa86ece574ff59da44debc92461c5d2af">__Simbox::fieldgroup</a></div><div class="ttdeci">__Fieldgroup fieldgroup</div><div class="ttdoc">当前box中所有grid上的场，是fields的一个二维数组 </div><div class="ttdef"><b>Definition:</b> simbox.h:127</div></div>
<div class="ttc" id="class____Vect3_html"><div class="ttname"><a href="../../da/d1a/class____Vect3.html">__Vect3&lt; double &gt;</a></div></div>
<div class="ttc" id="class____Laser_html_a3adbde5637037815e00d66856233efea"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#a3adbde5637037815e00d66856233efea">__Laser::delta_t</a></div><div class="ttdeci">double delta_t</div><div class="ttdoc">更新时间间隔dt </div><div class="ttdef"><b>Definition:</b> laser.h:14</div></div>
<div class="ttc" id="class____Laser_html_a57188568219826c448ed6b030601bb13"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#a57188568219826c448ed6b030601bb13">__Laser::xysize</a></div><div class="ttdeci">__Vect2&lt; double &gt; xysize</div><div class="ttdoc">空间dx dy </div><div class="ttdef"><b>Definition:</b> laser.h:18</div></div>
<div class="ttc" id="class____Laser_html_a425ffb2d0b73f19e1d10d364ea214202"><div class="ttname"><a href="../../d1/d4f/class____Laser.html#a425ffb2d0b73f19e1d10d364ea214202">__Laser::position</a></div><div class="ttdeci">vector&lt; __Vect2&lt; long &gt; &gt; position</div><div class="ttdoc">与电场信息对应的位置 </div><div class="ttdef"><b>Definition:</b> laser.h:34</div></div>
<div class="ttc" id="class____Simbox_html"><div class="ttname"><a href="../../d9/d37/class____Simbox.html">__Simbox</a></div><div class="ttdoc">初始化一个模拟盒子，这个模拟盒子包含cell信息，粒子信息，场信息。粒子种类信息也在这里。 ...</div><div class="ttdef"><b>Definition:</b> simbox.h:51</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Jun 16 2015 22:48:37 for hybridMPIC by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
